package dao;

import essenceClasses.User;
import interfaceDao.IUserDao;
import model.UserModel;

import java.sql.SQLException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: user
 * Date: 25.05.14
 * Time: 11:52
 * To change this template use File | Settings | File Templates.
 */
public class UserDao implements IUserDao {
    private UserModel userModel;

    public UserDao() {

        userModel = new UserModel();
    }


    @Override
    public List<User> getAllUser() throws SQLException {
        return userModel.getAllUser();
    }

    @Override
    public User getUser(String login) throws SQLException {
        return userModel.getUser(login);  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public User addUser(String login, String pass, String fio, int access) throws SQLException {
        System.out.println("ADD DAO");

        return userModel.addUser(login, pass, fio, access);

    }

    @Override
    public int getAccesUser(String login) throws SQLException {
        return userModel.getAccesUser(login);  //To change body of implemented methods use File | Settings | File Templates.
    }


}
